<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%   
String path = request.getContextPath();   
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
%> 
<!DOCTYPE html>
<html>
<head>
    <title>我的短文</title>
    <base href="<%=basePath%>"> 
    <link rel="shortcut icon" href="<%=basePath%>img/favo.ico">
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/todc-bootstrap.css" rel="stylesheet">
    <link href="css/global.css" rel="stylesheet">
    <link href="css/layout.css" rel="stylesheet">
    <link href="css/user.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="js/attension.js"></script>
</head>

<body>
<jsp:include page="include/topbar.jsp"></jsp:include>
<jsp:include page="include/logobar.jsp"></jsp:include>
<div class="layout grid-s5m0">
	<div class="col-sub user-nav">
		<jsp:include page="include/usernav_c.jsp"></jsp:include>
	</div>
	<div class="main-wrap">
		<div class="box user-bd">
			<div class="tl" style="height:auto;">
				<h3 style="margin-top:30px;">
					简介:<span class="saved"><font>${user.profile}<c:if test='${user.profile==null or user.profile==""}'>这家伙很懒，什么也没留下...</c:if></font></span>
				</h3>
				<h3>
					<span class="saved"><font>职业:&nbsp;${user.profession }<c:if test="${user.profession==null or user.profession=='' }">游民</c:if></font>&nbsp;&nbsp;&nbsp;主页:&nbsp;
					<c:choose>
						<c:when test="${user.privateUrl==null or  user.privateUrl==''}">
							<a href="<%=com.constant.ParamUtil.domain %>c/home/${user.id }.html"><%=com.constant.ParamUtil.domain %>c/home/${user.id }.html</a>
						</c:when>
						<c:otherwise>
							<a href="<%=com.constant.ParamUtil.domain %>${user.privateUrl }.html"><%=com.constant.ParamUtil.domain %>${user.privateUrl }.html</a>
						</c:otherwise>
					</c:choose>
					</span>
				</h3>
				<h3>
					<span class="saved"><font>答案:&nbsp;</font></span>${user.answersNum+0 }&nbsp;
					<span class="saved"><font>短文:&nbsp;</font></span>${user.articleNum+0 }&nbsp;
				</h3>
			</div>
			<div style="clear:both"></div>
			<div class="bd">
				<div class="tagsinput">
					<span id="taglist">
						<c:forEach var="tag" items="${tags }">
							<span class="badge tag">&nbsp;${tag.name }&nbsp;</span>
		                </c:forEach>
	                </span>
                </div>
                <div class="timeline" id="timeline">
                	<div class="event box">
                		<div class="hd tl">
                			<h3>
                			发表短文<span class="saved">[&nbsp;共${articles.allRow }条&nbsp;]</span>
                			</h3>
                		</div>
                		<div class="bd">
                		<c:forEach var='map' items='${articles.list }'>
					        <div class='article event'>
								<div class='head'>
									<img src='upload/head/${map.user_head }?s=50' onerror='this.src="upload/head/m/default.jpg?s=50"'/>
								</div>
							 <div class='body'>
								<div class='hd'>
									<p>
										<span class='name'>他</span>
										<span>问自己：</span>
							        	${map.title }
									</p>
								</div>
								<div class='bd'>
									<p class='show'>
									${map.content }
									</p>
								</div>
								<div class='ft'>
									<p>
										<span class='date'>
											${map.create_at }
										</span>
										<span class='action up' onclick="doAction('article','agree',${map.id },this)">
											顶(<em>${map.agree_num }</em>)
										</span>
										<span class='action down' onclick="doAction('article','disagree',${map.id },this)">
											踩(<em>${map.disagree_num }</em>)
										</span>
										<span class='action' onclick="doAction('article','collect',${map.id },this)">
											收藏(<em>${map.collect_num }</em>)
										</span>
										<span class='action' onclick="doAction('article','favor',${map.id },this)">
											喜欢(<em>${map.favor_num }</em>)
										</span>
										<span class='action comment'>
											<a href="c/a/${map.id }.html">评论(<em>${map.comments_num }</em>)</a>
										</span>
									</p>
								</div>
							</div>
							</div>
	               		</c:forEach>
                		</div>
                	</div>
					<div class="pagination pagination-centered">
					<ul>
						<c:if test="${articles.hasPreviousPage == true}">
							<li><a href="c/self/${user.id }.html?page=${articles.currentPage-1 }">上一页</a></li>
						</c:if>
						<c:forEach var="x" begin="${articles.startPage }" end="${articles.endPage }" step="1"> 
							<li <c:if test="${x==articles.currentPage }">class="disabled"</c:if>><a href="c/self/${user.id }.html?page=${x }">${x }</a></li>
						</c:forEach>
						<c:if test="${articles.hasNextPage ==true }">
							<li><a href="c/self/${user.id }.html?page=${articles.currentPage+1 }">下一页</a></li>
						</c:if>
						
					</ul>
				</div>
                </div>
			</div>
		</div>
	</div>
</div>
<input type="hidden" value="<%=basePath%>" id="baseUrl"/>
<jsp:include page="include/foot.jsp"></jsp:include>
</body>
</html>